<?php
	if($cU['User']['group_id']==1)
		$action = 'admin';
	else
		$action = 'main';

?>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Volver', true), array('controller'=>'users', 'action'=>$action, $cU['User']['id']));?></li>
		<li><?php echo $html->link(__('Editar', true), array('action'=>'edit', $tournamentgroup['Tournamentgroup']['id']));?></li>
	</ul>
</div>
<div class="tournamentgroups view">
<h2><?php  __('Equipo');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Nombre del Grupo'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $tournamentgroup['Tournamentgroup']['name']; ?>
			&nbsp;
		</dd>
	</dl>
</div>

<div class="related">
	<h3><?php __('Miembros del Equipo');?></h3>
	<?php if (!empty($tournamentgroup['UserTournament'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('WCG-ID'); ?></th>
		<th><?php __('Miembros'); ?></th>
		<th><?php __('Capitan'); ?></th>
		<th><?php __('Estatus'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($userTournaments as $userTournament):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo 'WCGVE'.str_pad($userTournament['User']['wcgid'], 4, "0", STR_PAD_LEFT);?></td>
			<td><?php echo trim($userTournament['User']['name'].' '.$userTournament['User']['lastname']);?></td>
			<td><?php echo ($userTournament['UserTournament']['captaingroup'])?'Si':'No';?></td>
			<?php if($userTournament['UserTournament']['captaingroup']):?>
			<td><?php echo 'Activo';?>
			<?php else:?>
			<td><?php echo ($userTournament['UserTournament']['memberstatus'])?'Activo':'Inactivo';?></td>
			<?php endif;?>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>


</div>

